import { channels } from '@/api/index'
const state = {
  navList: [],
  classSty: 0
}
const mutations = {
  setNavList (state, val) {
    state.navList = val
  },
  setClassSty (state, val) {
    state.classSty = val
  }
}
const getters = {}
const actions = {
  async getNavList (store) {
    const { data: { data } } = await channels()
    console.log(data)
    store.commit('setNavList', data.channels)
    store.dispatch('list/getMsgList', store.state.classSty, { root: true })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions
}
